# -*- encoding: utf-8 -*-
from copy import deepcopy
product_price_list = [5, 14, 54, 62, 19, 4, 3, 2.9, 3, 3.5, 4, 3.9, 9, 16, 35, 46, 25, 21, 23]
full_price = 222.1
total = sum(product_price_list)
chose_list = []
solution = []


def solve(product_price_list, chose_list):
    if sum(chose_list) >= full_price:
        chose = deepcopy(chose_list)
        solution.append(chose)
        # print(chose_list)

    for idx, p in enumerate(product_price_list):
        chose_list.append(p)
        solve(product_price_list[idx + 1:], chose_list)
        chose_list.remove(p)


if __name__ == '__main__':
    solve(product_price_list, chose_list)
    solution.sort(key=lambda x: sum(x))
    for s in solution[:10]:
        print(s, sum(s))
    # solution.sort(key=lambda x: sum(x))
